Repository navigation
fix: cast Postgre batch subquery values so updateBatch() and deleteBatch() accept mixed PHP types - #10601
Conversation
fe8ef19 to
22146f8
Compare
22146f8 to
ef96d2b
Compare
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Mapped or qualified columns can remain uncast, while enum, domain, and array metadata can generate invalid PostgreSQL casts.
Review effort: Balanced
Findings: 1
Open (3)
What changed in this PR
Fixes PostgreSQL batch updates/deletes with mixed PHP value types by casting subquery values to target column types.
Changes:
- Adds PostgreSQL value casting for batch operations.
- Adds live database regression tests.
- Documents the fix in the 4.7.5 changelog.
Base branch assumed to be develop. Static review performed; database validation remains with GitHub Actions.
| File | Description |
|---|---|
system/Database/Postgre/Builder.php |
Casts PostgreSQL batch subquery values. |
tests/system/Database/Live/UpdateTest.php |
Tests mixed-type batch updates. |
tests/system/Database/Live/DeleteTest.php |
Tests mixed-type batch deletes. |
user_guide_src/source/changelogs/v4.7.5.rst |
Records the bug fix. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
ef96d2b to
4bc33aa
Compare
michalsn
left a comment
There was a problem hiding this comment.
Casting delete constraint values to CHAR(n) can change which rows match. For example, with a CHAR(3) column, 'ABCD' is truncated to 'ABC', so deleteBatch() can delete the row containing 'ABC' even though the supplied value does not match it. The comparison should preserve the full input value.
4bc33aa to
0244f8c
Compare
Fixed. The casting now uses |
0244f8c to
dd4ebfd
Compare
e55b24e to
ea06ab4
Compare
…eBatch()` accept mixed PHP types
ea06ab4 to
0a8e4d7
Compare
|
Thank you, @michalsn , for the reviews! |


Description
Fixes #10599
Checklist: